#ifndef QQTDATATRANSLATESESSION_H
#define QQTDATATRANSLATESESSION_H

#include <QObject>
#include <QUuid>
#include <QTimer>

#include <qqtdataserialization.h>

#include <qqthighgrade_global.h>
/**
 * @brief The QQtDataTranslateSession class
 * 数据传输会话
 *
 * 从会话层开始，数据携带ACK，变得可信。
 *
 * uuid:
 * request: dataserialization
 * reply: dataserialization
 *
 */
class QQTHIGHGRADESHARED_EXPORT QQtDataTranslateSession : public QObject
{
    Q_OBJECT

public:
    explicit QQtDataTranslateSession ( QObject* parent = 0 );
    virtual ~QQtDataTranslateSession();

    enum SessionStatus
    {
        Normal,
        Timeout,

        Max
    };

    //可以自定义描述。
    QString& uuid();

    QQtDataSerialization& request();

    QQtDataSerialization& response();

    SessionStatus& status();

    QTimer* timer();

    void setTimerInterval ( int millscond );
    int timerInterval();

protected:

private:
    QTimer* mTimer;
    SessionStatus mStatus;
    QString mUuid;
    QQtDataSerialization mReq;
    QQtDataSerialization mRsp;
};

#endif // QQTDATATRANSLATESESSION_H

